module decoder(in, out);
//recebe um sinal binario na entrada e gera um sinal one-hot na saida.
input [2:0] in;
output reg [7:0] out;

always @(*) begin
    case(in)
        8'd0 : out = 8'b00000001;
        8'd1 : out = 8'b00000010;
        8'd2 : out = 8'b00000100;
        8'd3 : out = 8'b00001000;
        8'd4 : out = 8'b00010000;
        8'd5 : out = 8'b00100000;
        8'd6 : out = 8'b01000000;
        8'd7 : out = 8'b10000000;
    endcase
end

endmodule
